<template>
  <div id="window2">
    <!--              头部：标题-->
    <div style="padding: 5px">
      <el-row>
        <!--        标题-->
        <el-col :span="17" style="text-align: right;">矛盾纠纷地区统计</el-col>
        <!--        关闭按钮-->
        <el-col :span="7" style="text-align: right;">
          <div>
            <el-popconfirm title="是否关闭该窗口" @confirm="closeWindow">
              <template #reference>
                <el-icon>
                  <CircleClose/>
                </el-icon>
              </template>
            </el-popconfirm>
          </div>
        </el-col>
      </el-row>
    </div>

    <!-- 次标题 -->
    <div style="text-align: left;padding-left: 10px">
      <div>状态：已调节</div>
      <div>时间段：2018-06-10至2018-06-14</div>
    </div>

    <!-- 主体：-->
    <div>
      <div ref="chart" style="width: 100%; height: 100%; margin-top: 20px"></div>
    </div>



  </div>

</template>

<script>

import * as echarts from 'echarts';
import {defineComponent} from "vue";

import { defineEmits } from 'vue'

const emit = defineEmits()

const closeWindow = () => {
  emit('closeWindow')
}
// 柱状图
export default defineComponent({
  data() {
    return {
      chart: null,
    };
  },
  mounted() {
    this.chart = echarts.init(this.$refs.chart);
    this.renderChart();
  },
  methods: {
    renderChart() {
      const option = {
        series: [
          {
            name: 'Nightingale Chart',
            type: 'pie',
            radius: [20, 50],
            center: ['50%', '60%'],
            roseType: 'area',
            itemStyle: {
              borderRadius: 8
            },
            data: [
              {value: 2, name: 'X县'},
              {value: 10, name: 'Y县'},
              {value: 28, name: 'Z县'},
              {value: 40, name: '康定市'}
            ]
          }
        ]
      };


      this.chart.setOption(option);
    },
  },
})
</script>

<style scoped>

</style>
